import http from '@/axios/http.ts'
import { createNotesInfoRequest, notesQueryRequest, notesInfoResponse } from "@/models/notesModel.ts";

/**
 * 创建闲书
 * @param {*} p 
 * @returns 
 */
export const createNotes = (parmas: createNotesInfoRequest) => {
    return http.post('/Notes/CreateNotes', parmas);
}

/**
 * 获取闲书列表
 * @param {*} p 
 * @returns 
 */
export const getNotesList = (parmas: notesQueryRequest) => {
    return http.get('/Notes/GetNotesList', parmas);
}

/**
 * 根据id获取闲书内容
 * @param parmas 
 * @returns 
 */
export const getNotesContentById = (parmas: String) => {
    return http.get('/Notes/GetNotesContentById', parmas)
}

/**
 * 根据id获取闲书
 * @param parmas 
 * @returns 
 */
export const getNotesById = (parmas: String) => {
    return http.get('/Notes/GetNotesById', parmas)
}

/**
 * 删除闲书
 * @param parmas 
 * @returns 
 */
export const deleteById = (parmas: String) => {
    return http.del('/Notes/DeleteById', parmas)
}

/**
 * 修改
 * @param parmas 
 * @returns 
 */
export const updateNotes = (parmas: notesInfoResponse) => {
    return http.post('/Notes/UpdateNotes', parmas)
}